import java.util.Scanner;

public class num1313 {
	 public static void main(String[] args){
	       int T,a,b;
	       try(Scanner scan=new Scanner(System.in)){
	    	   T=scan.nextInt();
	    	   while(T!=0) {
	    		   T--;
	    		   a=scan.nextInt();
	    		   b=scan.nextInt();
	    		   System.out.print(b-a+" "+a);
	    		   System.out.println();
	    	   }
	       }
	    }
}
